﻿//创建时间: 2010-10-11
//创建作者: 李 城
//功能说明: 录入可选值管理
//最后修改: 李城 2010-10-12 新增获取可选值 树形结构 
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Reflection;

using TRPOP.Common;
using TRPOP.CMS.Model;

namespace TRPOP.CMS.DALFactory
{
    public interface IFormInputValueDAL
    {

        ///	<summary>
        ///	保存
        ///	</summary>
        ///	<param name="FormInputValueInfo"></param>
        ///	<returns>EnumSubmitResult</returns>
        EnumSubmitResult Save(FormInputValueInfo info);

        ///	<summary>
        ///	获取实体
        ///	</summary>
        ///	<param name="formInputValueId"></param>
        ///	<returns>FormInputValueInfo</returns>
        FormInputValueInfo GetInfoById(int id);

        ///	<summary>
        ///	删除
        ///	</summary>
        ///	<param name="id"></param>
        ///	<returns>EnumSubmitResult</returns>
        EnumSubmitResult DeleteInfoById(int id);

        ///	<summary>
        ///	删除
        ///	</summary>
        ///	<param name="ids"></param>
        ///	<returns>EnumSubmitResult</returns>
        EnumSubmitResult DeleteInfoByIds(string ids);

        ///	<summary>
        ///	自定义列表（无分页）
        ///	</summary>
        ///	<param name="topn">前N条，为0时表示所有符合条件的</param>
        ///	<param name="condition">自定义条件，要以And开头</param>
        ///	<param name="orderby">排序，不需要Order by </param>
        ///	<returns>List<FormInputValueInfo></returns>
        List<FormInputValueInfo> GetListByCondition(int topn, string condition, string orderby);

        ///	<summary>
        ///	自定义列表（分页）
        ///	</summary>
        ///	<returns>List<FormInputValueInfo></returns>
        List<FormInputValueInfo> GetListByPager(int pageNumber, int pageSize, string condition, string orderby, out int recordCount);

        /// <summary>
        /// 获取可选值的树形结构 
        /// </summary>
        /// <param name="FormInputValueTypeId">可选值类型id</param>
        /// <param name="ParentId">可选值的父id</param>
        /// <param name="level">预设的级数</param>
        /// <param name="Condition">外加的条件</param>
        /// <returns></returns>
        List<FormInputValueInfoWithLevel> GetFormInputValueListTree(int FormInputValueTypeId, int ParentId, int level, string Condition);
    }


    public sealed partial class DataAccess
    {
        public static IFormInputValueDAL CreateFormInputValueDAL()
        {
            string className = path + ".FormInputValueDAL";
            return (IFormInputValueDAL)Assembly.Load(path).CreateInstance(className);
        }
    }
}
